package org.example.com.entity;

import org.example.com.annotation.MRPAnnotations;

import java.util.HashMap;
import java.util.Map;

/**
 * 物料清单
 */
@MRPAnnotations.MRPEntity("物料清单")
public class BillOfMaterials {
    @MRPAnnotations.MRPField(description = "父级物料")
    private Item parent;

    @MRPAnnotations.MRPField(description = "子级物料及其数量")
    private Map<Item, Integer> components = new HashMap<>();

    public void addComponent(Item item, int quantity) {
        components.put(item, quantity);
    }

    public Map<Item, Integer> getComponents() {
        return components;
    }

    public Item getParent() {
        return parent;
    }

    public void setParent(Item parent) {
        this.parent = parent;
    }
}